<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script src="static/jquery/jquery.min.js"></script>
<html>
<head>
    <title>个人中心</title>
    <link href="${pageContext.request.contextPath}/static/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath }/static/css/taobao.css" rel="stylesheet" />

<script type="text/javascript">
    function edit() {
        if($("#bj").text() == "保存"){
            $("#sub").submit();
        }
        $("#name").removeAttr("disabled")
        $("#email").removeAttr("disabled")
        $("#phone").removeAttr("disabled")
        $("#address").removeAttr("disabled")
        $("#bj").text("保存");
    }
</script>
</head>
<body>
<!-- 横幅导航条开始 -->
<%@ include file="/WEB-INF/view/common/nva.jsp" %>

<div class="container">
    <div class="panel panel-default">
        <div class="panel-heading">
            <span>信息列表</span>
            <span class="pull-right">
<%--<a href="<c:url value="/updateUser"/>" class="btn btn-sm btn-success"> --%>
    <span id="bj" class="btn btn-sm btn-success" onclick="edit()" style="cursor: pointer">编辑</span>
</span>
</div>
<div class="panel-body">
    <form action="updateUser" method="post" id="sub">
        <input type="hidden" name="id" value="${user.id}"/>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
    <th>姓名</th>
    <th>性别</th>
    <th>邮箱</th>
    <th>电话</th>
    <th>地址</th>
    <th>审核状态</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="text" id="name" name="name" value="${user.name}" disabled/>
</td>
<td>
<c:choose>
<c:when test="${user.sex eq '1'}">男</c:when>
<c:otherwise>女</c:otherwise>
</c:choose>
</td>
<td>
<input type="text" id="email" name="email" value="${user.email}" disabled/>
</td>
<td>
<input type="text" id="phone" name="phone" value="${user.phone}" disabled/>
</td>
<td>
<input type="text" id="address" name="address" value="${user.address}" disabled/>
</td>
    <td>
        <c:choose>
            <c:when test="${user.disabled eq '1'}">
                审核已通过
            </c:when>
            <c:otherwise>
                待审核
            </c:otherwise>
        </c:choose>
    </td>
</tr>
</tbody>
</table></form>
</div>
</div>
</div>
</body>
</html>
